package ui.tests;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
import pages.BasePage;
import pages.HomePage;
import utils.Log4Test;

import java.util.concurrent.TimeUnit;

/**
 * Created by sky_lady on 5/29/14.
 */
public class CommonTestSteps extends BasicTest {

    public void login() {
        homePage.open();
        Assert.assertTrue(homePage.isOpened());
    }

    public void searchProduct(String productName) {
        HomePage page = new HomePage(driver);
        Assert.assertTrue(page.searchProduct(productName));
    }

    public void searchUnknownProduct(String productName) {
        HomePage page = new HomePage(driver);
        Assert.assertFalse(page.searchProduct(productName));
    }

    public void addToComparison() {
        HomePage page = new HomePage(driver);
        Assert.assertTrue(page.addProductToComparison());
    }

    public void checkComparison(String product1,String product2) {
        HomePage page = new HomePage(driver);
        Assert.assertTrue(page.checkComparison(product1, product2));
    }
}

